<?php 
class user_profile 
{ 
	function profile_basic() 
	{ 
		global $mysql_conn,$v_file;
		$user_id = $_COOKIE['user_id'];
		$user_name = $_COOKIE['user_name'];
		$user_type = $_COOKIE['user_type'];
		$type_name = $_COOKIE['type_name'];
		$sql = "SELECT * from `user_info` WHERE `info_id` = '".$user_id."'";
		$result = mysql_query($sql,$mysql_conn);
		@$row = mysql_fetch_array($result);
		$name = $row['name'];
		$sex = $row['sex'];
		$birthday = $row['birthday'];
		$address = $row['address'];
		$telphone = $row['telphone'];
		$tel = $row['tel'];
		$qq = $row['qq'];
		$wechat = $row['wechat'];
		$alipay = $row['alipay'];
		$email = $row['email'];
		$questions1 = $row['questions1'];
		$questions2 = $row['questions2'];
		$questions3 = $row['questions3'];
		$answer1 = $row['answer1'];
		$answer2 = $row['answer2'];
		$answer3 = $row['answer3'];
		require($v_file);
	}
	function profile_basic_do() 
	{ 
		global $mysql_conn;
		$user_id = $_COOKIE['user_id'];
		$name = $_POST['name'];
		$sex = $_POST['sex'];
		$birthday = $_POST['birthday'];
		$address = $_POST['address'];
		$sql = "UPDATE `user_info` SET `name` = '".$name."', `sex` = '".$sex."', `birthday` = '".$birthday."', `address` = '".$address."' WHERE `info_id` =".$user_id.";";
		$result = mysql_query($sql,$mysql_conn);
		@$row = mysql_fetch_array($result);
		echo "1";
	}
	function profile_contacts() 
	{ 
		global $mysql_conn,$v_file;
		$user_id = $_COOKIE['user_id'];
		$user_name = $_COOKIE['user_name'];
		$user_type = $_COOKIE['user_type'];
		$type_name = $_COOKIE['type_name'];
		$sql = "SELECT * from `user_info` WHERE `info_id` = '".$user_id."'";
		$result = mysql_query($sql,$mysql_conn);
		@$row = mysql_fetch_array($result);
		$name = $row['name'];
		$sex = $row['sex'];
		$birthday = $row['birthday'];
		$address = $row['address'];
		$telphone = $row['telphone'];
		$tel = $row['tel'];
		$qq = $row['qq'];
		$wechat = $row['wechat'];
		$alipay = $row['alipay'];
		$email = $row['email'];
		$questions1 = $row['questions1'];
		$questions2 = $row['questions2'];
		$questions3 = $row['questions3'];
		$answer1 = $row['answer1'];
		$answer2 = $row['answer2'];
		$answer3 = $row['answer3'];
		require($v_file);
	}
	function profile_contacts_do() 
	{ 
		global $mysql_conn;
		$user_id = $_COOKIE['user_id'];
		$telphone = $_POST['telphone'];
		$tel = $_POST['tel'];
		$qq = $_POST['qq'];
		$wechat = $_POST['wechat'];
		$alipay = $_POST['alipay'];
		$email = $_POST['email'];
		$sql = "UPDATE `user_info` SET `telphone` = '".$telphone."', `tel` = '".$tel."', `qq` = '".$qq."', `wechat` = '".$wechat."', `alipay` = '".$alipay."', `email` = '".$email."' WHERE `info_id` =".$user_id.";";
		$result = mysql_query($sql,$mysql_conn);
		@$row = mysql_fetch_array($result);
		echo "1";
	}
	function profile_safe() 
	{ 
		global $mysql_conn,$v_file;
		$user_id = $_COOKIE['user_id'];
		$user_name = $_COOKIE['user_name'];
		$user_type = $_COOKIE['user_type'];
		$type_name = $_COOKIE['type_name'];
		$sql = "SELECT * from `user_info` WHERE `info_id` = '".$user_id."'";
		$result = mysql_query($sql,$mysql_conn);
		@$row = mysql_fetch_array($result);
		$name = $row['name'];
		$sex = $row['sex'];
		$birthday = $row['birthday'];
		$address = $row['address'];
		$telphone = $row['telphone'];
		$tel = $row['tel'];
		$qq = $row['qq'];
		$wechat = $row['wechat'];
		$alipay = $row['alipay'];
		$email = $row['email'];
		$questions1 = $row['questions1'];
		$questions2 = $row['questions2'];
		$questions3 = $row['questions3'];
		$answer1 = $row['answer1'];
		$answer2 = $row['answer2'];
		$answer3 = $row['answer3'];
		require($v_file);
	}
	function profile_safe_do() 
	{ 
		global $mysql_conn;
		$user_id = $_COOKIE['user_id'];
		$questions1 = $_POST['questions1'];
		$questions2 = $_POST['questions2'];
		$questions3 = $_POST['questions3'];
		$answer1 = $_POST['answer1'];
		$answer2 = $_POST['answer2'];
		$answer3 = $_POST['answer3'];
		$sql = "UPDATE `user_info` SET `questions1` = '".$questions1."', `questions2` = '".$questions2."', `questions3` = '".$questions3."', `answer1` = '".$answer1."', `answer2` = '".$answer2."', `answer3` = '".$answer3."' WHERE `info_id` =".$user_id.";";
		$result = mysql_query($sql,$mysql_conn);
		@$row = mysql_fetch_array($result);
		echo "1";
	}
} 
/* End of file democontroller.php */ 